package main.Link;

import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import java.awt.*;

public class CellRendererColorOther extends DefaultTableCellRenderer {


        private String rrow;

        public CellRendererColorOther(String rrow) {
            this.rrow = rrow;
        }

        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {

            if (table.getValueAt(row, 0).equals(rrow)) {
                super.setBackground(isSelected ? SystemColor.textHighlight : new Color(175, 227, 193));
            } else {
                super.setBackground(isSelected ? SystemColor.textHighlight : new Color(255,255,255));
            }
            super.setForeground(isSelected ? Color.black : Color.black);
            super.setText(value == null ? "" : value.toString());
            super.setFont(new Font("Calibri", 0, 12));

            return this;
        }
    }

